package fhp.hlhj.giantfold.module

import com.lzy.okgo.model.HttpParams
import fhp.hlhj.giantfold.javaBean.ErroBean
import fhp.hlhj.giantfold.javaBean.GoodsDetailBean
import fhp.hlhj.giantfold.network.UrlApis

/**
 * author: FHP
 * data: on 2017\12\5 0005 15:07
 * E-Mail: 103945089@qq.com
 */
class GoodsDetailModule {

    interface goodsDetailLoadingListener{
        fun showLoading()
        fun over(goodsDetailBean: GoodsDetailBean)
        fun erro(erro:ErroBean)
    }
    fun getGoodsInfo(params: HttpParams,goodsId:String,goodsDetailLoadingListener: goodsDetailLoadingListener){
        UrlApis.getGoodsDetail(params,goodsId)
                .doOnSubscribe {
                    goodsDetailLoadingListener.showLoading()
                }
                .subscribe ({
                    data->
                    goodsDetailLoadingListener.over(data)
                },{

                })
    }
}